home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9544 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: __argv[0] bug under Win 95?
  5. Date: 10 Mar 96 00:11:08 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.826416668@rscernix>
  8. References: <4hr196$1hl@murphy2.servtech.com>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4hr196$1hl@murphy2.servtech.com> Terry Carmen <tpcarmen@servtech.com> writes:
  13.  
  14. >For some reason __argv[0] is empty under Windows 95, but contains the program name 
  15. >and path as it should under Win 3.1x and Win NT.
  16.  
  17. So what.  There is no such thing as __argv[0] in the C language.  If you
  18. name the second argument of main() __argv, you invoke undefined behaviour,
  19. because this symbol is not in your namespace.
  20.  
  21. >Does anybody have any idea why, or how I can obtain the name of the currently 
  22. >executing (16 bit) app under Win 95?
  23.  
  24. As far as C is concerned, argv[0] is not required to contain the
  25. program name, so there's nothing to be done if it doesn't.
  26.  
  27. For a Windows-specific solution, this is the wrong newsgroup.
  28.  
  29. Dan
  30. --
  31. Dan Pop
  32. CERN, CN Division
  33. Email: danpop@mail.cern.ch 
  34. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  35.